<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/items.css" />

<div id="container" class="photos clearfix">
<!--div class="box">
    <?php/*
        $connection=Yii::app()->db;
        $sql = "SELECT count(t1.ten_tag) as soluong, t1.ten_tag as ten FROM tag t1, hinh_tag t2 where t2.id_tag = t1.id GROUP BY t1.id ORDER BY soluong DESC LIMIT 50";
        $command=$connection->createCommand($sql);
        $dataReader=$command->query();
        $count = 50;
        foreach($dataReader as $row) { 
            $size = $count/8;
            echo '<a style="padding-left:10px;" href="index.php?r=site/explore&key='.$row['ten'].'"><font size="'.$size.'px">'.$row['ten'].'</font></a> ';
            $count--;
        }*/
    ?>
</div-->
    <?php
    if(isset($_GET['key']))
    $this->widget('zii.widgets.CListView', array(
        'dataProvider' => $model->searchAlbum($_GET['key']),
        'itemView'=>'_albumListItem',   // refers to the partial view named '_post'
        'sortableAttributes'=>array(
            'id'=>'Thời gian',
            'ten_album' => 'Tên Album',
        ),
        'template' => '<div class="box">{sorter}</div>{items}{pager}',
    )); else 
    $this->widget('zii.widgets.CListView', array(
        'dataProvider' => $model->search(),
        'itemView'=>'_albumListItem',   // refers to the partial view named '_post'
        'sortableAttributes'=>array(
            'id'=>'Thời gian',
            'ten_album' => 'Tên Album',
        ),
        'template' => '<div class="box">{sorter}</div>{items}{pager}',
    )); 
    ?>
</div>
<script type="text/javascript">
    $(function () {

        var $container = $('#container .items');

        $container.imagesLoaded(function () {
            $container.isotope({
                itemSelector: '.photo'
            });
        });
    });
</script>
</div>